﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:p="clr-namespace:Lithnet.Acma.Presentation"
                    xmlns:c="clr-namespace:Lithnet.Common.Presentation;assembly=Lithnet.Common.Presentation">

    <HierarchicalDataTemplate DataType="{x:Type p:DBQueryGroupViewModel}"
                              ItemsSource="{Binding Path=DBQueryObjects}">

        <p:TreeViewItemControl>
            <p:TreeViewItemControl.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Add query"
                              Command="{Binding Commands.AddQueryByValue}" />
                    <Separator />
                    <MenuItem Header="Add query group"
                              Command="{Binding Commands.AddQueryGroup}" />
                    <Separator />

                    <MenuItem Header="Delete"
                              Command="{Binding Commands.DeleteQueryGroup}" />
                    <Separator />

                    <MenuItem Header="Cut"
                              Command="{Binding Commands.Cut}" />
                    <MenuItem Header="Copy"
                              Command="{Binding Commands.Copy}" />
                    <MenuItem Header="Paste"
                              Command="{Binding Commands.Paste}" />
                </ContextMenu>
            </p:TreeViewItemControl.ContextMenu>
        </p:TreeViewItemControl>

    </HierarchicalDataTemplate>

    <HierarchicalDataTemplate DataType="{x:Type p:DBQueryObjectsViewModel}"
                              ItemsSource="{Binding Path=.}">
        <p:TreeViewItemControl>
            <p:TreeViewItemControl.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Add query"
                              Command="{Binding Commands.AddQueryByValue}" />
                    <Separator />
                    <MenuItem Header="Add query group"
                              Command="{Binding Commands.AddQueryGroup}" />
                </ContextMenu>
            </p:TreeViewItemControl.ContextMenu>
        </p:TreeViewItemControl>
    </HierarchicalDataTemplate>

    <HierarchicalDataTemplate DataType="{x:Type p:DBQueryByValueViewModel}">
        <p:TreeViewItemControl>
            <p:TreeViewItemControl.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Delete query"
                              Command="{Binding Commands.DeleteQuery}" />
                    <Separator />

                    <MenuItem Header="Cut"
                              Command="{Binding Commands.Cut}" />
                    <MenuItem Header="Copy"
                              Command="{Binding Commands.Copy}" />
                </ContextMenu>
            </p:TreeViewItemControl.ContextMenu>
        </p:TreeViewItemControl>
    </HierarchicalDataTemplate>
</ResourceDictionary>